import {Directive, ElementRef, Input, OnInit} from '@angular/core';
declare var $: any;
@Directive({
  selector: '[appScroll]'
})

export class ScrollDirective implements OnInit {

  @Input() height: number;
  defaultHeight = '100%';
  constructor(public element: ElementRef) { }

  ngOnInit() {
    $(this.element.nativeElement).slimScroll({
      height: (this.height || this.defaultHeight),
      disableFadeOut: true
    });
  }

}
